<extend name="Public/layout"/>
<block name="head">
    <link rel="stylesheet" href="__PUBLIC__css/platform-details.css">
    <script src="__PUBLIC__assets/better-scroll/bscroll.min.js"></script>
    <style type="text/css">
        .footer {
            display: none;
        }
    </style>
</block>
<block name="main">
    <div class="banner">
        <div class="content-wrapper">
            <a href="/Home/Video/appraisal_info/p_id/{$plat.id}/cate_id/1">
                <div class="content-top">
                    <div class="logo-wrapper">
                        <img src="{$plat.pic}?x-oss-process=image/resize,w_110" alt="">
                    </div>
                    <div class="tag-wrapper">
                        <notempty name="plat.background"><span class="tag">{$plat.background}</span>
                        </notempty>
                        <if condition="$plat.deposit neq '暂无'"><span class="tag">{$plat.deposit}</span></if>
                    </div>
                </div>
                <div class="content-middle">
                    <h3>
                        <if condition="$plat.team_type eq 'CPA+CPS'">
                            首投返现{$plat.user_award}元
                            <elseif condition="$plat.team_type eq 'CPA' and $plat.id neq 12"/>
                            首投返现{$plat.user_award}元
                            <elseif condition="$plat.id eq 12"/>
                            首投返投资额×{$plat.user_roi}%
                            <else/>
                            返投资额×{$plat.user_roi}%
                        </if>
                    </h3>
                    <p>点击了解平台测评></p>
                </div>
                <div class="content-bottom">
                    <div class="info-wrapper">
                        <div class="profit-wrapper">
                            <p class="data">{$plat.yields}</p>
                            <p class="item-desc">往期收益</p>
                        </div>
                        <div class="money-wrapper">
                            <p class="data">{$plat.start_amount}元</p>
                            <p class="item-desc">起投金额</p>
                        </div>
                    </div>
                </div>
                        <if condition="$plat.is_port eq 1">
                        <!--如果是一键投，显示下面的sign1-->
                        <div class="plat-sign1"></div>
                        <!--如果是跳转投，显示下面的sign2-->
                        <else/>
                        <div class="plat-sign2"></div>
                        </if>
            </a>
        </div>
    </div>
    <!--我的合作平台-->
    <div class="my-platform">
        <div class="my-platform-header">
            <h4>投资方案</h4>
        </div>
        <div class="my-platform-content">
            <ul class="my-platform-wrapper">
                <foreach name="plat_obj" item="v" key="k">
                    <li class="my-platform-item">
                        <a>
                            <if condition="$plat.team_type eq 'CPA+CPS'">

                                <div class="item-left">
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">首投返利</div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>返现{$v.user_award}元</p>
                                    </div>
                                </div>

                                <elseif condition="$plat.team_type eq 'CPA' and $plat.id neq 12"/>
                                <div class="item-left">
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">首投返利</div>
                                    </div>
                                    <div class="tag-msg">
                                        <p>返现{$v.user_award}元</p>
                                    </div>
                                </div>

                                <elseif condition="$plat.id eq 12"/>
                                <div class="item-left">
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">首投返投资金额×{$v.user_roi}%</div>
                                    </div>
                                    <!-- <div class="tag-msg">
                                        <p>复投用户加息{$v.push_award}</p>
                                    </div>  -->
                                </div>

                                <else/>
                                <div class="item-left">
                                    <div class="plat-tag-wrapper">
                                        <div class="plat-tag">返投资金额×{$v.user_roi}%</div>
                                    </div>
                                    <!-- <div class="tag-msg">
                                        <p>复投用户加息{$v.rebate}%</p>
                                    </div> -->
                                </div>

                            </if>


                            <div class="item-center">
                                <ul class="item-info-wrapper">
                                    <li>
                                        <div class="left">投资期限</div>
                                        <div class="right">
                                            <if condition="$v.deadline_unit eq 0">{$v.deadline}个月
                                                <else/>
                                                {$v.deadline}天
                                            </if>
                                        </div>
                                    </li>
                                    <li>
                                        <div class="left">起投金额</div>
                                        <div class="right">{$v.invest}元</div>
                                    </li>
                                    <li>
                                        <div class="left">往期收益</div>
                                        <div class="right dc3838">{$v.yields}%</div>
                                    </li>
                                </ul>
                            </div>
                            <div class="item-right">
                                <div class="btn-wrapper">
                                    <div class="plat-btn">方案{$k+1}</div>
                                </div>
                            </div>
                        </a>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>
<if condition="$plat.first_official">
    <!--平台温馨提示-->
    <div class="plat-tip-wrapper">
        <p class="tip">{$plat.first_official}</p>
    </div>
</if>
    <!--平台背景，股东信息，资产类型-->
    <div class="platform-detail">
        <ul class="platform-detail-header">
            <li class="active">平台背景</li>
            <li>股东信息</li>
            <li>资产类型</li>
        </ul>
        <div class="platform-detail-body">
            <!--平台背景-->
            <div class="platform-background">
                <div class="background-item clearfix">
                    <div class="left">平台背景</div>
                    <div class="right">{$plat.background}</div>
                </div>
                <div class="background-item clearfix">
                    <div class="left">注册资金</div>
                    <div class="right">{$plat.fund}</div>
                </div>
                <div class="background-item clearfix">
                    <div class="left">银行存管</div>
                    <div class="right">{$plat.deposit}</div>
                </div>
                <div class="background-item clearfix">
                    <div class="left">资产类型</div>
                    <div class="right">{$plat.property}</div>
                </div>
                <div class="background-item clearfix">
                    <div class="left">往期收益</div>
                    <div class="right">{$plat.yields}</div>
                </div>
                <div class="background-item clearfix">
                    <div class="left">上线时间</div>
                    <div class="right">{$plat.online}</div>
                </div>
            </div>
            <!--股东信息-->
            <div class="platform-partner" style="display: none">
                <div class="partner-item">
                    <div class="img-wrapper">
                        <img src="{$plat.plat_map}" alt="">
                    </div>
                </div>
                <foreach name="plat.plat_team" item="v">
                    <div class="partner-item">
                        <div class="leader-wrapper">
                            <div class="left">
                                <img src="{$v.pic}" alt="" width=70 height=91>
                            </div>
                            <div class="right">
                                <h5>{$v.name} {$v.position}</h5>
                                <p>{$v.introduce}</p>
                            </div>
                        </div>
                    </div>
                </foreach>
            </div>
            <!--资产类型-->
            <div class="platform-type" style="display: none">
                <foreach name="plat.plat_assets" item="v">
                    <div class="type-item">
                        <h5>{$v.object}</h5>
                        <p>{$v.assets}</p>
                    </div>
                </foreach>
            </div>
        </div>
        <div class="platform-detail-bottom">
            <notempty name="plat.video">
                <div class="bottom-item clearfix">
                    <div class="title"><a href="javascript:">平台评测<span class="icon-arrow"></span></a></div>
                    <div class="img-wrapper clearfix" id="imgListWrapper">
                        <ul class="plat-ceping-img-wrapper clearfix">
                            <foreach name="plat.video" item="v">
                                <if condition="$v.id neq 574">
                                    <li class="img-item">
                                        <a href="/Home/Video/appraisal_info/p_id/{$plat.id}/v_id/{$v.id}/cate_id/{$v.cate_id}"><img src="{$v.pic}?x-oss-process=image/resize,w_130" alt=""></a>
                                    </li>
                                </if>
                            </foreach>
                        </ul>
                    </div>
                </div>
            </notempty>
            
            <empty name="plat.video">
            <if condition="$is_content eq 1">
                <div class="bottom-item clearfix">
                    <div class="title"><a href="/Home/Video/appraisal_info/p_id/{$plat.id}/cate_id/1">平台评测<span class="icon-arrow"></span></a></div>
                </div>
            </if>
            </empty>

            
            <div class="bottom-item clearfix">
                <div class="left">在线QQ客服</div>
                <div class="right">1000828</div>
            </div>
             <div class="bottom-item clearfix">
                <div class="title">免责声明</div>
                <div class="text-wrapper">
                    <p>8号金融街仅为信息平台，本身不吸纳用户资金。
                        8号金融街上展示的网贷平台活动不保证100%安全，如出现意外情况（包括但不限于平台逾期、提现困难、倒闭、跑路等导致无法拿回本金的情况），如该活动享8号金融街保障，8号金融街仅在该活动注明的保障期和保障范围内，按照保障合同进行赔付。 
                        </p>
                    <p>除此之外，8号金融街不承担任何责任！</p>
                </div>
            </div>
        </div>
    </div>
    <!--返利流程-->
    <div class="return">
        <div class="return-header">
            <h3>返利流程</h3>
        </div>
        <div class="return-content">
            <img src="__PUBLIC__images/platform-details-return-content.png" alt="">
            <ul class="return-step-wrapper clearfix" style="display: none;">
                <li class="return-step">
                    <div class="icon-wrapper">
                        <span class="icon-number">1</span>
                    </div>
                    <div class="text-wrapper">
                        <p class="text">注册返利账户用户</p>
                    </div>
                </li>
                <li class="return-step">
                    <div class="icon-wrapper">
                        <span class="icon-number">1</span>
                    </div>
                    <div class="text-wrapper">
                        <p class="text">选择平台跳转投资</p>
                    </div>
                </li>
                <li class="return-step">
                    <div class="icon-wrapper">
                        <span class="icon-number">1</span>
                    </div>
                    <div class="text-wrapper">
                        <p class="text">即日返利至返利账户</p>
                    </div>
                </li>
                <li class="return-step">
                    <div class="icon-wrapper">
                        <span class="icon-number">1</span>
                    </div>
                    <div class="text-wrapper">
                        <p class="text">发起提现，1个工作日提现至绑定银行卡</p>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <!--按钮-->
<!--     <div class="bottom-btn-wrapper">
        <a href="javascript:"
        <if condition="($plat.id eq 5) or ($plat.id eq 7)"> onclick="sub(1)"
            <else/>
            onclick="sub(2)"
        </if>
        >直接投资拿返利</a>
    </div> -->
    <div class="bottom-btn-wrapper">
	<a href="javascript:" onclick="sub()">直接投资拿返利</a>
        
    </div>
    <form id="formdata" action="" method="post">
        <input type="hidden" id="fdata" name='data' value=''>
    </form>
</block>
<block name="js">
    <script src="__PUBLIC__js/platform-details.js"></script>
    <script>
	function is_error(){
	  layer.open({
		content: '数据异常，请联系在线客服！'
		,btn: '确定'
		,end:function(){location.href="/"}
	  });
	}

        var imgWidth = $(".img-item").width();
        var imgMargin = parseFloat($(".img-item").css("margin-right"));
        var imgCount = $(".plat-ceping-img-wrapper").children().length;
        var imgWrapperWidth = (imgWidth + imgMargin) * imgCount + imgMargin
        $(".plat-ceping-img-wrapper").css("width", imgWrapperWidth);

        setTimeout(function () {
            var wrapper1 = document.querySelector("#imgListWrapper")
            if (!wrapper1) {
                return
            }
            var scroll1 = new BScroll(wrapper1, {
                scrollX: true,
                scrollY: false,
                probeType: 1,
                click: true,
                eventPassthrough: 'vertical'
            })
        }, 200)

        var userid = "{$_SESSION['user']['id']}";
        var userphone = "{:hidtel($_SESSION['user']['user_phone'])}";
        function sub(val) {
            var plat_id = "{$_GET['plat_id']}";
            if (userid) {
                location.href="/Home/Platform/jump_to_platform/plat_id/"+plat_id
            } else {
                layer.open({
                    content: '请先登录！'
                    , skin: 'msg'
                    , time: 1
                    , end: function () {
                        location.href = "/Home/User/login?callback=/Home/Platform/platform_detail/plat_id/"+plat_id
                    }
                });
            }

        }

        $('.platform-detail-header').on('click', 'li', function () {
            $(this).addClass('active').siblings().removeClass('active');
            var index = $(this).index();
            $('.platform-detail-body').children().eq(index).show().siblings().hide();
        })

        // 未对接平台跳转弹框
        // var h = ''
        // h += '<div class="platform-layer unjoint-platform"><h5>正在为您跳转平台</h5>'
        // h += '<div class="plat-logo"><img src="{$plat.pic}" width="110px" height="28px"></div>'
        // h += '<div class="text-wrapper">'
        // h += '<p class="text">跳转后使用<span class="username">' + userphone + '</span>注册, 并投资对应的标的注册平台时, 请不要填写邀请码</p></div>'
        // h += '<div class="bottom-wrapper"><p>如果不是通过8号金融街注册</p><p>将不享受返利</p></div>'
        // h += '</div>'

        // function unjointPlatform() {
        //     layer.open({
        //         content: h,
        //         type: 1
        //     })
        // }

        // function jointPlatform() {
        //     var plat_id = "{$_GET['plat_id']}";
        //     $.post('{:U("Platform/jump_to_platform")}',function() {

        //     });
        // }


        // 已对接平台跳转弹框
        // var h1 = ''
        // h1 += '<div class="platform-layer joint-platform"><h5>正在为您生成平台账户</h5>'
        // h1 += '<div class="plat-logo"><img src="{$plat.pic}" width="110px" height="28px"></div>'
        // h1 += '<div class="text-wrapper">'
        // h1 += '<p class="text">为您生成的{$plat.name}账户为<span class="username">' + userphone + '</span>初始登录密码将以短信的形式发送给您</p></div>'
        // h1 += '</div>'

        // function jointPlatform() {
        //     layer.open({
        //         content: h1,
        //         type: 1,
        //         time: 1500
        //     })
        // }

        // 已在别的渠道注册的用户
  //       var h2 = ''
  //       h2 += '<div class="platform-layer not-a-menber"><h5>正在为您跳转平台</h5>'
  //       h2 += '<div class="plat-logo"><img src="{$plat.pic}" width="110px" height="28px"></div>'
  //       h2 += '<div class="text-wrapper">'
  //       h2 += '<p class="text">您已通过其他渠道注册了{$plat.name}，继续通过8号金融街跳转，将不会享受返利</p></div>'
  //       h2 += '<div class="btn-wrapper"><a href="javascript:" onclick="layer.closeAll()">返回8号金融街</a></div>'
  //       h2 += '</div>'


  //       function notjointPlatform() {
        // layer.closeAll()
  //           layer.open({
  //               content: h2,
  //               type: 1
  //           })

  //       }

        function bind_plat() {

            var id = "{$_GET['plat_id']}";
            //console.log(id);return
            if (id == 2) {

                //绑定用户
                $.post('{:U("Platform/wy_bind_user")}', {
                    id: id
                }, function (res) {
                    if (res.err == 0) {

                        if (res.msg == 1) {
                            notjointPlatform();

                        } else {
                            var path = res.url;
                            $('#fdata').val(res.data);
                            $('#formdata').attr('action', path);
                            $('#formdata').submit();
                        }
                    }
                })

            } else if (id == 8) {

                $.post('{:U("Platform/gs_bind_user")}', {
                    id: id
                }, function (res) {
                    if (res.err == 0) {
                        if (res.msg == 1) {
                           notjointPlatform();
                        } else {
                            var path = res.url;
                            $('#fdata').val(res.data);
                            $('#formdata').attr('action', path);
                            $('#formdata').submit();
                        }

                    }

                })
            } else if (id == 11) {
                console.log(1)
                $.post('{:U("Platform/zr_bind_user")}', {
                    id: id
                }, function (res) {
                    console.log(res);
                    if (res.err == 0) {

                        if (res.msg == 1) {
                           notjointPlatform();
                        } else {
                            var path = res.url;
                            $('#fdata').val(res.data);
                            $('#formdata').attr('action', path);
                            $('#formdata').submit();
                        }

                    }

                })
            } else if (id == 12) {
                $.post('{:U("Platform/wj_bind_user")}', {
                    id: id
                }, function (res) {
                    //console.log(res);return;
                    if (res.err == 0) {

                        if (res.msg == 1) {
                           notjointPlatform();
                        } else {
                            var path = res.url;
                            $('#fdata').val(res.data);
                            $('#formdata').attr('action', path);
                            $('#formdata').submit();
                        }

                    }

                })
            } else if (id == 1) {
                $.post('{:U("Platform/ph_bind_user")}', {
                    id: id
                }, function (res) {
                    //console.log(res);return;
                    if (res.err == 0) {

                        if (res.msg == 1) {
                            notjointPlatform();
                        } else {
                            var path = res.url;
                            $('#fdata').val(res.data);
                            $('#formdata').attr('action', path);
                            $('#formdata').submit();
                        }

                    }

                })
            } else {
                var plat_url = "{$plat.land_page}";
                location.href = plat_url
            }

        }
		var title="8号金融街-首投红包领不停！！"
		var desc = '8号金融街精选多家优质平台，稳健赚利息还有首投红包领！'
		var link=window.location.href
		var imgUrl='http://www.8hjie.com/App/Home/Public/images/wx_fx.jpg' 

    </script>
</block>